package com.etoak.controller;


import com.etoak.OrderSericeApplication;
import com.etoak.common.core.vo.ResultVO;
import com.etoak.dto.OrderDTO;
import com.etoak.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * OrderController
 *
 * @author etoak
 * @since 2025-02-07
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    OrderService orderService;

    /**
     * 创建订单post请求 /order
     * @param orderDTO
     * @return
     */
    @PostMapping
    public ResultVO<Object> create(@Validated @RequestBody OrderDTO orderDTO) {
        orderService.create(orderDTO);
        return ResultVO.success();
    }
}

